/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

/**
 *
 * @author Ee Ting
 */

import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class ProductionPk implements java.io.Serializable{
    
    //@Column(name = "productionDate")
    private Date productionDate;
    //@Column(name="productID")
    private Long productID;  
    
    public ProductionPk(){}
    
    public ProductionPk(String ProDate, String productID)
    {
        this.setProductionDate(Date.valueOf(ProDate));
        this.setProductID(Long.parseLong(productID));

    }

    public Long getProductID() {
        return productID;
    }

    public void setProductID(Long productID) {
        this.productID = productID;
    }

    public Date getProductionDate() {
        return productionDate;
    }

    public void setProductionDate(Date productionDate) {
        this.productionDate = productionDate;
    }
    

   
    public boolean equals(Object obj)
    {
        if(obj==this) return true;
        if(!(obj instanceof ProductionPk)) return false;
        ProductionPk pk = (ProductionPk)obj;
        if(!(productionDate.equals(pk.productionDate))) return false;
        if(!(productID.equals(pk.productID))) return false;
        return true;
    }
    
    public int hashCode()
    {
        return productionDate.hashCode()+productID.hashCode();
    }
            
}
